/*

Dofile: table10_appendix.do 

Date: Dec. 10, 2016 
Aim: Present the baseline regressions (using effective marginal taxe rate data) - [2-98] thresholds 

Input: base_for_reg.dta 
Output: table10_appendix.xls 
Reported in the paper: "Table A.10: Baseline regression Effective Marginal Tax Rate, all firms, 2%-98% thresholds"

*/  

cd $datapath
use base_for_reg, clear 

global name table10_appendix // name of the xls file where the results are sent 

global tax_var inter_linvemtr linvemtr // tax variable and its interaction 
areg luv type $tax_var if tarif!=. , absorb(fpt) vce(cluster pays)
outreg2  type $tax_var inter_tarif tarif inter_lgdpc lgdpc inter_ldist ldist  using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2    replace 

areg luv type $tax_var inter_tarif tarif inter_lgdpc lgdpc inter_ldist ldist   , absorb(fpt) vce(cluster pays)
outreg2  type $tax_var inter_tarif tarif inter_lgdpc lgdpc inter_ldist ldist    using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2    append 

global tax_var interdum_hines dum_hines
areg luv type $tax_var inter_tarif tarif inter_lgdpc lgdpc inter_ldist ldist  , absorb(fpt) vce(cluster pays)
outreg2  type $tax_var inter_tarif tarif inter_lgdpc lgdpc inter_ldist ldist    using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2   append 

global tax_var interdum_hines dum_hines inter_linvemtr linvemtr 
areg luv type $tax_var inter_tarif tarif inter_lgdpc lgdpc inter_ldist ldist    , absorb(fpt) vce(cluster pays)
outreg2  type $tax_var inter_tarif tarif inter_lgdpc lgdpc inter_ldist ldist    using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2   append 

areg luv type $tax_var inter_tarif tarif inter_lgdpc lgdpc inter_ldist ldist  if dum_hines==0, absorb(fpt) vce(cluster pays)
outreg2  type $tax_var inter_tarif tarif inter_lgdpc lgdpc inter_ldist ldist  using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2    append 

global tax_var interdum_hines  inter_linvemtr // level variables not included - absorbed by the FE 
reghdfe luv type $tax_var inter_tarif inter_lgdpc inter_ldist  if tarif!=. , absorb(fpt c) vce(cluster pays)
outreg2  type $tax_var inter_tarif tarif inter_lgdpc lgdpc inter_ldist ldist   using  "$resultpath/$name.xls" ,  label e(all) nocons bdec(2) symbol($^{***}$, $^{**}$, $^{*}$) adjr2    append 

